home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / educate / astrw116.zip / MSDETCT2.INC < prev    next >
Text File  |  1993-12-22  |  17KB  |  523 lines

  1. '**************************************************************************
  2. '*************************  Setup Detect API's  ***************************
  3. '**************************************************************************
  4.  
  5. ''detect
  6.  
  7. DECLARE FUNCTION CbGetVersionOfFile LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  8. DECLARE FUNCTION LGetVersionNthField LIB "msdetstf.dll" (szVersion$, nField%) AS LONG
  9. DECLARE FUNCTION LcbGetSizeOfFile LIB "msdetstf.dll" (szFile$) AS LONG
  10. DECLARE FUNCTION FGetValidDrivesList LIB "msdetstf.dll" (szSymbol$) AS INTEGER
  11. DECLARE FUNCTION FGetLocalHardDrivesList LIB "msdetstf.dll" (szSymbol$) AS INTEGER
  12. DECLARE FUNCTION FGetRemovableDrivesList LIB "msdetstf.dll" (szSymbol$) AS INTEGER
  13. DECLARE FUNCTION FGetNetworkDrivesList LIB "msdetstf.dll" (szSymbol$) AS INTEGER
  14. DECLARE FUNCTION LcbTotalDrive LIB "msdetstf.dll" (nDrive%) AS LONG
  15. DECLARE FUNCTION LcbFreeDrive LIB "msdetstf.dll" (nDrive%) AS LONG
  16. DECLARE FUNCTION FIsValidDrive LIB "msdetstf.dll" (nDrive%) AS INTEGER
  17. DECLARE FUNCTION FIsLocalHardDrive LIB "msdetstf.dll" (nDrive%) AS INTEGER
  18. DECLARE FUNCTION FIsRemoveDrive LIB "msdetstf.dll" (nDrive%) AS INTEGER
  19. DECLARE FUNCTION FIsRemoteDrive LIB "msdetstf.dll" (nDrive%) AS INTEGER
  20. DECLARE FUNCTION FDirExists LIB "msdetstf.dll" (szDir$) AS INTEGER
  21. DECLARE FUNCTION FDoesFileExist LIB "msdetstf.dll" (szFileName$, mode%) AS INTEGER
  22. DECLARE FUNCTION CbGetDateOfFile LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  23. DECLARE FUNCTION FDoesIniSectionExist LIB "msdetstf.dll" (szFile$, szSect$) AS INTEGER
  24. DECLARE FUNCTION FDoesIniKeyExist LIB "msdetstf.dll" (szFile$, szSect$, szKey$) AS INTEGER
  25. DECLARE FUNCTION CbGetIniKeyString LIB "msdetstf.dll" (szFile$, szSect$, szKey$, szBuf$, cbBuf%) AS INTEGER
  26. DECLARE FUNCTION WGetDOSMajorVersion LIB "msdetstf.dll" AS INTEGER
  27. DECLARE FUNCTION WGetDOSMinorVersion LIB "msdetstf.dll" AS INTEGER
  28. DECLARE FUNCTION CbGetEnvVariableValue LIB "msdetstf.dll" (szEnvVar$, szBuf$, cbBuf%) AS INTEGER
  29. DECLARE FUNCTION CbFindTargetOnEnvVar LIB "msdetstf.dll" (szFile$, szEnvVar$, szBuf$, cbBuf%) AS INTEGER
  30. DECLARE FUNCTION CbFindFileInTree LIB "msdetstf.dll" (szFile$, szDir$, szBuf$, cbBuf%) AS INTEGER
  31. DECLARE FUNCTION GetTypeFaceNameFromTTF LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  32. DECLARE FUNCTION GetExistingFOTFileForTTF LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  33.  
  34.  
  35.  
  36. '*************************************************************************
  37. '****************  Detect Basic Wrapper Declarations  ********************
  38. '*************************************************************************
  39.  
  40.  
  41. '' detect
  42.  
  43. DECLARE FUNCTION IsDriveValid (szDrive$) AS INTEGER
  44. DECLARE FUNCTION IsDriveLocalHard (szDrive$) AS INTEGER
  45. DECLARE FUNCTION IsDriveRemovable (szDrive$) AS INTEGER
  46. DECLARE FUNCTION IsDriveNetwork (szDrive$) AS INTEGER
  47. DECLARE SUB GetValidDrivesList (szSymbol$)
  48. DECLARE SUB GetLocalHardDrivesList (szSymbol$)
  49. DECLARE SUB GetRemovableDrivesList (szSymbol$)
  50. DECLARE SUB GetNetworkDrivesList (szSymbol$)
  51. DECLARE FUNCTION GetTotalSpaceForDrive (szDrive$) AS LONG
  52. DECLARE FUNCTION GetFreeSpaceForDrive (szDrive$) AS LONG
  53.  
  54. DECLARE FUNCTION GetDOSMajorVersion AS INTEGER
  55. DECLARE FUNCTION GetDOSMinorVersion AS INTEGER
  56. DECLARE FUNCTION GetEnvVariableValue (szEnvVar$) AS STRING
  57. DECLARE FUNCTION GetNumWinApps AS INTEGER
  58.  
  59. DECLARE FUNCTION DoesFileExist (szFile$, mode%) AS INTEGER
  60. DECLARE FUNCTION GetDateOfFile (szFile$) AS STRING
  61. DECLARE FUNCTION GetYearFromDate (szDate$) AS INTEGER
  62. DECLARE FUNCTION GetMonthFromDate (szDate$) AS INTEGER
  63. DECLARE FUNCTION GetDayFromDate (szDate$) AS INTEGER
  64. DECLARE FUNCTION GetHourFromDate (szDate$) AS INTEGER
  65. DECLARE FUNCTION GetMinuteFromDate (szDate$) AS INTEGER
  66. DECLARE FUNCTION GetSecondFromDate (szDate$) AS INTEGER
  67. DECLARE FUNCTION GetVersionOfFile (szFile$) AS STRING
  68. DECLARE FUNCTION GetVersionNthField (szVersion$, nField%) AS LONG
  69. DECLARE FUNCTION GetSizeOfFile (szFile$) AS LONG
  70. DECLARE FUNCTION FindTargetOnEnvVar (szFile$, szEnvVar$) AS STRING
  71. DECLARE FUNCTION FindFileInTree (szFile$, szDir$) AS STRING
  72. DECLARE FUNCTION DoesDirExist (szDir$) AS INTEGER
  73.  
  74. DECLARE FUNCTION DoesIniSectionExist (szFile$, szSect$) AS INTEGER
  75. DECLARE FUNCTION DoesIniKeyExist (szFile$, szSect$, szKey$) AS INTEGER
  76. DECLARE FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) AS STRING
  77.  
  78. '*************************************************************************
  79. FUNCTION IsDriveValid (szDrive$) STATIC  AS INTEGER
  80. '$ifdef DEBUG
  81.     if FValidDrive(szDrive$) = 0 then
  82.         BadArgErr 1, "IsDriveValid", szDrive$
  83.     end if
  84. '$endif ''DEBUG
  85.     IsDriveValid = FIsValidDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  86. END FUNCTION
  87.  
  88.  
  89. '*************************************************************************
  90. FUNCTION IsDriveLocalHard (szDrive$) STATIC  AS INTEGER
  91. '$ifdef DEBUG
  92.     if FValidDrive(szDrive$) = 0 then
  93.         BadArgErr 1, "IsDriveLocalHard", szDrive$
  94.     end if
  95. '$endif ''DEBUG
  96.     IsDriveLocalHard = FIsLocalHardDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  97. END FUNCTION
  98.  
  99.  
  100. '*************************************************************************
  101. FUNCTION IsDriveRemovable (szDrive$) STATIC  AS INTEGER
  102. '$ifdef DEBUG
  103.     if FValidDrive(szDrive$) = 0 then
  104.         BadArgErr 1, "IsDriveRemovable", szDrive$
  105.     end if
  106. '$endif ''DEBUG
  107.     IsDriveRemovable = FIsRemoveDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  108. END FUNCTION
  109.  
  110.  
  111. '*************************************************************************
  112. FUNCTION IsDriveNetwork (szDrive$) STATIC  AS INTEGER
  113. '$ifdef DEBUG
  114.     if FValidDrive(szDrive$) = 0 then
  115.         BadArgErr 1, "IsDriveNetwork", szDrive$
  116.     end if
  117. '$endif ''DEBUG
  118.     IsDriveNetwork = FIsRemoteDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  119. END FUNCTION
  120.  
  121.  
  122. '*************************************************************************
  123. FUNCTION GetTotalSpaceForDrive (szDrive$) STATIC  AS LONG
  124. '$ifdef DEBUG
  125.     if FValidDrive(szDrive$) = 0 then
  126.         BadArgErr 1, "GetTotalSpaceForDrive", szDrive$
  127.     end if
  128. '$endif ''DEBUG
  129.     GetTotalSpaceForDrive = LcbTotalDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  130. END FUNCTION
  131.  
  132.  
  133. '*************************************************************************
  134. FUNCTION GetFreeSpaceForDrive (szDrive$) STATIC  AS LONG
  135. '$ifdef DEBUG
  136.     if FValidDrive(szDrive$) = 0 then
  137.         BadArgErr 1, "GetFreeSpaceForDrive", szDrive$
  138.     end if
  139. '$endif ''DEBUG
  140.     GetFreeSpaceForDrive = LcbFreeDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  141. END FUNCTION
  142.  
  143.  
  144. '*************************************************************************
  145. SUB GetValidDrivesList (szSymbol$) STATIC
  146. '$ifdef DEBUG
  147.     if szSymbol$ = "" then
  148.         BadArgErr 1, "GetValidDrivesList", szSymbol$
  149.     end if
  150. '$endif ''DEBUG
  151.     if FGetValidDrivesList(szSymbol$) = 0 then
  152. '$ifdef DEBUG
  153.         StfApiErr saeFail, "GetValidDrivesList", szSymbol$
  154. '$endif ''DEBUG
  155.         ERROR STFERR
  156.     end if
  157. END SUB
  158.  
  159.  
  160. '*************************************************************************
  161. SUB GetLocalHardDrivesList (szSymbol$) STATIC
  162. '$ifdef DEBUG
  163.     if szSymbol$ = "" then
  164.         BadArgErr 1, "GetLocalHardDrivesList", szSymbol$
  165.     end if
  166. '$endif ''DEBUG
  167.     if FGetLocalHardDrivesList(szSymbol$) = 0 then
  168. '$ifdef DEBUG
  169.         StfApiErr saeFail, "GetLocalHardDrivesList", szSymbol$
  170. '$endif ''DEBUG
  171.         ERROR STFERR
  172.     end if
  173. END SUB
  174.  
  175.  
  176. '*************************************************************************
  177. SUB GetRemovableDrivesList (szSymbol$) STATIC
  178. '$ifdef DEBUG
  179.     if szSymbol$ = "" then
  180.         BadArgErr 1, "GetRemovableDrivesList", szSymbol$
  181.     end if
  182. '$endif ''DEBUG
  183.     if FGetRemovableDrivesList(szSymbol$) = 0 then
  184. '$ifdef DEBUG
  185.         StfApiErr saeFail, "GetRemovableDrivesList", szSymbol$
  186. '$endif ''DEBUG
  187.         ERROR STFERR
  188.     end if
  189. END SUB
  190.  
  191.  
  192. '*************************************************************************
  193. SUB GetNetworkDrivesList (szSymbol$) STATIC
  194. '$ifdef DEBUG
  195.     if szSymbol$ = "" then
  196.         BadArgErr 1, "GetNetworkDrivesList", szSymbol$
  197.     end if
  198. '$endif ''DEBUG
  199.     if FGetNetworkDrivesList(szSymbol$) = 0 then
  200. '$ifdef DEBUG
  201.         StfApiErr saeFail, "GetNetworkDrivesList", szSymbol$
  202. '$endif ''DEBUG
  203.         ERROR STFERR
  204.     end if
  205. END SUB
  206.  
  207.  
  208. '*************************************************************************
  209. FUNCTION GetDOSMajorVersion STATIC  AS INTEGER
  210.     GetDOSMajorVersion = WGetDOSMajorVersion
  211. END FUNCTION
  212.  
  213.  
  214. '*************************************************************************
  215. FUNCTION GetDOSMinorVersion STATIC  AS INTEGER
  216.     GetDOSMinorVersion = WGetDOSMinorVersion
  217. END FUNCTION
  218.  
  219.  
  220. '*************************************************************************
  221. FUNCTION GetEnvVariableValue (szEnvVar$) STATIC  AS STRING
  222. '$ifdef DEBUG
  223.     if szEnvVar$ = "" then
  224.         BadArgErr 1, "GetEnvVariableValue", szEnvVar$
  225.     end if
  226. '$endif ''DEBUG
  227.     cb% = 1024
  228.     szBuf$ = STRING$(cb%, 32)
  229.     cbRet% = CbGetEnvVariableValue(szEnvVar$, szBuf$, cb%)
  230.     GetEnvVariableValue = szBuf$
  231. '$ifdef DEBUG
  232.     IF cbRet% >= cb% THEN
  233.         StfApiErr saeOvfl, "GetEnvVariableValue", szEnvVar$
  234.         ERROR STFERR
  235.     END IF
  236. '$endif ''DEBUG
  237.     szBuf$ = ""
  238. END FUNCTION
  239.  
  240.  
  241. '*************************************************************************
  242. FUNCTION GetNumWinApps STATIC  AS INTEGER
  243.     GetNumWinApps = WGetNumWinApps
  244. END FUNCTION
  245.  
  246.  
  247. '*************************************************************************
  248. FUNCTION DoesFileExist (szFileName$, mode%) STATIC  AS INTEGER
  249. '$ifdef DEBUG
  250.     if FValidFATPath(szFileName$) = 0 then
  251.         BadArgErr 1, "DoesFileExist", szFileName$+", "+STR$(mode%)
  252.     end if
  253. '$endif ''DEBUG
  254.     DoesFileExist = FDoesFileExist(szFileName$, mode%)
  255. END FUNCTION
  256.  
  257.  
  258. '*************************************************************************
  259. FUNCTION GetDateOfFile (szFile$) STATIC  AS STRING
  260. '$ifdef DEBUG
  261.     if FValidFATPath(szFile$) = 0 then
  262.         BadArgErr 1, "GetDateOfFile", szFile$
  263.     end if
  264. '$endif ''DEBUG
  265.     cb% = 20
  266.     szBuf$ = STRING$(cb%, 32)
  267.     cbRet% = CbGetDateOfFile(szFile$, szBuf$, cb%)
  268.     GetDateOfFile = szBuf$
  269. '$ifdef DEBUG
  270.     IF cbRet% >= cb% THEN
  271.         StfApiErr saeOvfl, "GetDateOfFile", szFile$
  272.         ERROR STFERR
  273.     END IF
  274. '$endif ''DEBUG
  275.     szBuf$ = ""
  276. END FUNCTION
  277.  
  278.  
  279. '*************************************************************************
  280. FUNCTION GetYearFromDate (szDate$) STATIC  AS INTEGER
  281. '$ifdef DEBUG
  282.     if szDate = "" then
  283.         BadArgErr 1, "GetYearFromDate", szDate$
  284.     end if
  285. '$endif ''DEBUG
  286.     GetYearFromDate = VAL(MID$(szDate$, 1, 4))
  287. END FUNCTION
  288.  
  289.  
  290. '*************************************************************************
  291. FUNCTION GetMonthFromDate (szDate$) STATIC  AS INTEGER
  292. '$ifdef DEBUG
  293.     if szDate = "" then
  294.         BadArgErr 1, "GetMonthFromDate", szDate$
  295.     end if
  296. '$endif ''DEBUG
  297.     GetMonthFromDate = VAL(MID$(szDate$, 6, 2))
  298. END FUNCTION
  299.  
  300.  
  301. '*************************************************************************
  302. FUNCTION GetDayFromDate (szDate$) STATIC  AS INTEGER
  303. '$ifdef DEBUG
  304.     if szDate = "" then
  305.         BadArgErr 1, "GetDayFromDate", szDate$
  306.     end if
  307. '$endif ''DEBUG
  308.     GetDayFromDate = VAL(MID$(szDate$, 9, 2))
  309. END FUNCTION
  310.  
  311.  
  312. '*************************************************************************
  313. FUNCTION GetHourFromDate (szDate$) STATIC  AS INTEGER
  314. '$ifdef DEBUG
  315.     if szDate = "" then
  316.         BadArgErr 1, "GetHourFromDate", szDate$
  317.     end if
  318. '$endif ''DEBUG
  319.     GetHourFromDate = VAL(MID$(szDate$, 12, 2))
  320. END FUNCTION
  321.  
  322.  
  323. '*************************************************************************
  324. FUNCTION GetMinuteFromDate (szDate$) STATIC  AS INTEGER
  325. '$ifdef DEBUG
  326.     if szDate = "" then
  327.         BadArgErr 1, "GetMinuteFromDate", szDate$
  328.     end if
  329. '$endif ''DEBUG
  330.     GetMinuteFromDate = VAL(MID$(szDate$, 15, 2))
  331. END FUNCTION
  332.  
  333.  
  334. '*************************************************************************
  335. FUNCTION GetSecondFromDate (szDate$) STATIC  AS INTEGER
  336. '$ifdef DEBUG
  337.     if szDate = "" then
  338.         BadArgErr 1, "GetSecondFromDate", szDate$
  339.     end if
  340. '$endif ''DEBUG
  341.     GetSecondFromDate = VAL(MID$(szDate$, 18, 2))
  342. END FUNCTION
  343.  
  344.  
  345. '*************************************************************************
  346. FUNCTION GetVersionOfFile (szFile$) STATIC  AS STRING
  347. '$ifdef DEBUG
  348.     if FValidFATPath(szFile$) = 0 then
  349.         BadArgErr 1, "GetVersionOfFile", szFile$
  350.     end if
  351. '$endif ''DEBUG
  352.     cb% = 30
  353.     szBuf$ = STRING$(cb%, 32)
  354.     cbRet% = CbGetVersionOfFile(szFile$, szBuf$, cb%)
  355.     GetVersionOfFile = szBuf$
  356. '$ifdef DEBUG
  357.     IF cbRet% >= cb% THEN
  358.         StfApiErr saeOvfl, "GetVersionOfFile", szFile$
  359.         ERROR STFERR
  360.     END IF
  361. '$endif ''DEBUG
  362.     szBuf$ = ""
  363. END FUNCTION
  364.  
  365.  
  366. '*************************************************************************
  367. FUNCTION GetVersionNthField (szVersion$, nField%) STATIC  AS LONG
  368. '$ifdef DEBUG
  369.     if (nField% < 1) OR (nField% > 4) then
  370.         BadArgErr 2, "GetVersionNthField", szVersion$+", "+STR$(nField%)
  371.     end if
  372. '$endif ''DEBUG
  373.     GetVersionNthField = LGetVersionNthField(szVersion$, nField%)
  374. END FUNCTION
  375.  
  376.  
  377. '*************************************************************************
  378. FUNCTION GetSizeOfFile (szFile$) STATIC  AS LONG
  379. '$ifdef DEBUG
  380.     if FValidFATPath(szFile$) = 0 then
  381.         BadArgErr 1, "GetSizeOfFile", szFile$
  382.     end if
  383. '$endif ''DEBUG
  384.     GetSizeOfFile = LcbGetSizeOfFile(szFile$)
  385. END FUNCTION
  386.  
  387.  
  388. '*************************************************************************
  389. FUNCTION FindTargetOnEnvVar (szFile$, szEnvVar$) STATIC  AS STRING
  390. '$ifdef DEBUG
  391.     if CchlValidFATSubPath(szFile$) = 0 then
  392.         n% = 1
  393.     elseif szEnvVar$ = "" then
  394.         n% = 2
  395.     else
  396.         n% = 0
  397.     end if
  398.     if n% > 0 then
  399.         BadArgErr n%, "FindTargetOnEnvVar", szFile$+", "+szEnvVar$
  400.     end if
  401. '$endif ''DEBUG
  402.  
  403.     cb% = 512
  404.     szBuf$ = STRING$(cb%, 32)
  405.     cbRet% = CbFindTargetOnEnvVar(szFile$, szEnvVar$, szBuf$, cb%)
  406.     IF cbRet% >= cb% THEN
  407. '$ifdef DEBUG
  408.         StfApiErr saeOvfl, "FindTargetOnEnvVar", szFile$+", "+szEnvVar$
  409. '$endif ''DEBUG
  410.         ERROR STFERR
  411.     END IF
  412.     szBuf$ = RTRIM$(szBuf$)
  413.     IF MID$(szBuf$, 1, 1) = "\" THEN
  414.        szBuf$ = MID$(CURDIR$, 1, 2) + szBuf$
  415.     ELSEIF Len(szBuf$) > 0 AND MID$(szBuf$, 2, 1) <> ":" THEN
  416.        szBuf$ = MID$(CURDIR$, 1, 3) + szBuf$
  417.     END IF
  418.     FindTargetOnEnvVar = szBuf$
  419.     szBuf$ = ""
  420. END FUNCTION
  421.  
  422.  
  423. '*************************************************************************
  424. FUNCTION FindFileInTree (szFile$, szDir$) STATIC  AS STRING
  425. '$ifdef DEBUG
  426.     if CchlValidFATSubPath(szFile$) = 0 then
  427.         n% = 1
  428.     elseif FValidFATDir(szDir$) = 0 then
  429.         n% = 2
  430.     else
  431.         n% = 0
  432.     end if
  433.     if n% > 0 then
  434.         BadArgErr n%, "FindFileInTree", szFile$+", "+szDir$
  435.     end if
  436. '$endif ''DEBUG
  437.  
  438.     cb% = 512
  439.     szBuf$ = STRING$(cb%, 32)
  440.     cbRet% = CbFindFileInTree(szFile$, szDir$, szBuf$, cb%)
  441.     FindFileInTree = szBuf$
  442. '$ifdef DEBUG
  443.     IF cbRet% >= cb% THEN
  444.         StfApiErr saeOvfl, "FindFileInTree", szFile$+", "+szDir$
  445.         ERROR STFERR
  446.     END IF
  447. '$endif ''DEBUG
  448.     szBuf$ = ""
  449. END FUNCTION
  450.  
  451.  
  452. '*************************************************************************
  453. FUNCTION DoesDirExist (szDir$) STATIC  AS INTEGER
  454. '$ifdef DEBUG
  455.     if FValidFATDir(szDir$) = 0 then
  456.         BadArgErr 1, "DoesDirExist", szDir$
  457.     end if
  458. '$endif ''DEBUG
  459.     DoesDirExist = FDirExists(szDir$)
  460. END FUNCTION
  461.  
  462.  
  463. '*************************************************************************
  464. FUNCTION DoesIniSectionExist (szFile$, szSect$) STATIC  AS INTEGER
  465. '$ifdef DEBUG
  466.     if FValidIniFile(szFile$) = 0 then
  467.         BadArgErr 1, "DoesIniSectionExist", szFile$+", "+szSect$
  468.     end if
  469. '$endif ''DEBUG
  470.     DoesIniSectionExist = FDoesIniSectionExist(szFile$, szSect$)
  471. END FUNCTION
  472.  
  473.  
  474. '*************************************************************************
  475. FUNCTION DoesIniKeyExist (szFile$, szSect$, szKey$) STATIC  AS INTEGER
  476. '$ifdef DEBUG
  477.     if FValidIniFile(szFile$) = 0 then
  478.         n% = 1
  479.     elseif szKey$ = "" then
  480.         n% = 3
  481.     else
  482.         n% = 0
  483.     end if
  484.     if n% > 0 then
  485.         BadArgErr n%, "DoesIniKeyExist", szFile$+", "+szSect$+", "+szKey$
  486.     end if
  487. '$endif ''DEBUG
  488.  
  489.     DoesIniKeyExist = FDoesIniKeyExist(szFile$, szSect$, szKey$)
  490. END FUNCTION
  491.  
  492.  
  493. '*************************************************************************
  494. FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) STATIC  AS STRING
  495. '$ifdef DEBUG
  496.     if FValidIniFile(szFile$) = 0 then
  497.         n% = 1
  498.     elseif szKey$ = "" then
  499.         n% = 3
  500.     else
  501.         n% = 0
  502.     end if
  503.     if n% > 0 then
  504.         BadArgErr n%, "GetIniKeyString", szFile$+", "+szSect$+", "+szKey$
  505.     end if
  506. '$endif ''DEBUG
  507.  
  508.     cb% = 512
  509.     szBuf$ = STRING$(cb%, 32)
  510.     cbRet% = CbGetIniKeyString(szFile$, szSect$, szKey$, szBuf$, cb%)
  511.     GetIniKeyString = szBuf$
  512. '$ifdef DEBUG
  513.     IF cbRet% >= cb% THEN
  514.         StfApiErr saeOvfl, "GetIniKeyString", szFile$+", "+szSect$+", "+szKey$
  515.         ERROR STFERR
  516.     END IF
  517. '$endif ''DEBUG
  518.     szBuf$ = ""
  519. END FUNCTION
  520.  
  521.  
  522.  
  523.